const book = {
  state: {
    fileName: '',
    menuVisible: false,
    settingVisible: -1, // -1标识不显示，0：字号，1：主题，2：进度，3：目录
    defaultFontSize: 16,
    defaultFontFamily: 'Default',
    fontFamilyVisible: false,
    defaultTheme: 'default',
    bookAvailable: false,
    progress: 0,
    section: 0,
    isPaginating: true,
    currentBook: null,
    navigation: null,
    cover: null,
    metadata: null,
    paginate: '',
    pageList: null,
    offsetY: 0,
    isBookmark: null
  },
  mutations: {
    'SET_FILENAME' (state, fileName) {
      state.fileName = fileName
    },
    'SET_MENUVISIBLE' (state, menuVisible) {
      state.menuVisible = menuVisible
    },
    'SET_SETTINGVISIBLE' (state, settingVisible) {
      state.settingVisible = settingVisible
    },
    'SET_DEFAULTFONTSIZE' (state, defaultFontSize) {
      state.defaultFontSize = defaultFontSize
    },
    'SET_DEFAULTFONTFAMILY' (state, defaultFontFamily) {
      state.defaultFontFamily = defaultFontFamily
    },
    'SET_FONTFAMILYVISIBLE' (state, fontFamilyVisible) {
      state.fontFamilyVisible = fontFamilyVisible
    },
    'SET_DEFAULTTHEME' (state, defaultTheme) {
      state.defaultTheme = defaultTheme
    },
    'SET_BOOKAVAILABLE' (state, bookAvailable) {
      state.bookAvailable = bookAvailable
    },
    'SET_PROGRESS' (state, progress) {
      state.progress = progress
    },
    'SET_SECTION' (state, section) {
      state.section = section
    },
    'SET_ISPAGINATING' (state, isPaginating) {
      state.isPaginating = isPaginating
    },
    'SET_CURRENTBOOK' (state, currentBook) {
      state.currentBook = currentBook
    },
    'SET_NAVIGATION' (state, navigation) {
      state.navigation = navigation
    },
    'SET_COVER' (state, cover) {
      state.cover = cover
    },
    'SET_METADATA' (state, metadata) {
      state.metadata = metadata
    },
    'SET_PAGINATE' (state, paginate) {
      state.paginate = paginate
    },
    'SET_PAGELIST' (state, pageList) {
      state.pageList = pageList
    },
    'SET_OFFSETY' (state, offsetY) {
      state.offsetY = offsetY
    },
    'SET_ISBOOKMARK' (state, isBookmark) {
      state.isBookmark = isBookmark
    }
  }
}

export default book
